Update with breaking changes from tonight's nigthly
authorAlex Crichton <alex@alexcrichton.com>
Fri, 7 Nov 2014 06:38:26 +0000 (22:38 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 7 Nov 2014 16:29:56 +0000 (08:29 -0800)
14 files changed:
Cargo.lock
Cargo.toml
src/cargo/core/registry.rs
src/cargo/core/resolver/encode.rs
src/cargo/core/resolver/mod.rs
src/cargo/core/source.rs
src/cargo/ops/cargo_compile.rs
src/cargo/ops/cargo_rustc/context.rs
src/cargo/ops/cargo_rustc/links.rs
src/cargo/ops/lockfile.rs
src/cargo/sources/registry.rs
src/cargo/util/config.rs
src/cargo/util/dependency_queue.rs
src/cargo/util/graph.rs

index cb96674e4d2fd45f99c158000fb560b1451de795..2ebe653e8ddf6fc20cdf8a32510c03050c9ac82a 100644 (file)
@@ -5,7 +5,7 @@ dependencies = [
  "curl 0.0.1 (git+https://github.com/alexcrichton/curl-rust?ref=bundle)",
  "docopt 0.6.8 (git+https://github.com/docopt/docopt.rs)",
  "flate2 0.0.1 (git+https://github.com/alexcrichton/flate2-rs)",
- "git2 0.0.1 (git+https://github.com/alexcrichton/git2-rs)",
+ "git2 0.0.1 (git+https://github.com/alexcrichton/git2-rs?ref=no-build-cmd)",
  "glob 0.0.1 (git+https://github.com/rust-lang/glob)",
  "hamcrest 0.1.0 (git+https://github.com/carllerche/hamcrest-rust.git)",
  "registry 0.0.1-pre",
@@ -34,7 +34,7 @@ source = "git+https://github.com/alexcrichton/curl-rust?ref=bundle#b595431adb3ff
 [[package]]
 name = "docopt"
 version = "0.6.8"
-source = "git+https://github.com/docopt/docopt.rs#1b614c83b771b23e95e69d10b4bc04c87ff7eff3"
+source = "git+https://github.com/docopt/docopt.rs#0b184b15ed5ea7e3c180b088e8f99baa4427f989"
 
 [[package]]
 name = "encoding"
@@ -81,9 +81,9 @@ source = "git+https://github.com/alexcrichton/flate2-rs#31d9253355ba837cd62487b8
 [[package]]
 name = "git2"
 version = "0.0.1"
-source = "git+https://github.com/alexcrichton/git2-rs#556e27113a4918cede9b80e447a5ebad524f3357"
+source = "git+https://github.com/alexcrichton/git2-rs?ref=no-build-cmd#b7a84b817bc62df62e4449b7d78aa3887bd3b4c7"
 dependencies = [
- "libgit2 0.0.1 (git+https://github.com/alexcrichton/git2-rs)",
+ "libgit2 0.0.1 (git+https://github.com/alexcrichton/git2-rs?ref=no-build-cmd)",
  "url 0.1.0 (git+https://github.com/servo/rust-url)",
 ]
 
@@ -100,7 +100,7 @@ source = "git+https://github.com/carllerche/hamcrest-rust.git#998036d000095f72c8
 [[package]]
 name = "libgit2"
 version = "0.0.1"
-source = "git+https://github.com/alexcrichton/git2-rs#556e27113a4918cede9b80e447a5ebad524f3357"
+source = "git+https://github.com/alexcrichton/git2-rs?ref=no-build-cmd#b7a84b817bc62df62e4449b7d78aa3887bd3b4c7"
 dependencies = [
  "libssh2-static-sys 0.0.1 (git+https://github.com/alexcrichton/libssh2-static-sys)",
  "link-config 0.0.1 (git+https://github.com/alexcrichton/link-config)",
@@ -142,12 +142,12 @@ source = "git+https://github.com/alexcrichton/tar-rs#47d2cc4b09e373a4cc7bee7c71e
 [[package]]
 name = "toml"
 version = "0.1.0"
-source = "git+https://github.com/alexcrichton/toml-rs#78acb5081d57bec85fd51ecb596506b14d17d430"
+source = "git+https://github.com/alexcrichton/toml-rs#ac6f3b27e03e7a5938fd4cae5fc3fecc5ab1a85f"
 
 [[package]]
 name = "url"
 version = "0.1.0"
-source = "git+https://github.com/servo/rust-url#9142b86a812ac5bc886f76235585557d8e002246"
+source = "git+https://github.com/servo/rust-url#cec3c32168ce4233e179f22ef50215b3a9c34342"
 dependencies = [
  "encoding 0.2.0 (git+https://github.com/lifthrasiir/rust-encoding)",
 ]
index a156101426737d80d5aea123fc676920dc3d3cbb..cb1bddbe0b14eeebd7a8fc4f7c50313cc78ba3f5 100644 (file)
@@ -35,6 +35,7 @@ git = "https://github.com/alexcrichton/flate2-rs"
 
 [dependencies.git2]
 git = "https://github.com/alexcrichton/git2-rs"
+branch = "no-build-cmd"
 
 [dependencies.glob]
 git = "https://github.com/rust-lang/glob"
index 26e613dae40504021eded2c8fe9b5375f5ad3fa0..eb4d45f20159350e1a6b3fa2b128b28dc7de0c1f 100644 (file)
@@ -109,7 +109,7 @@ impl<'a> PackageRegistry<'a> {
     }
 
     fn ensure_loaded(&mut self, namespace: &SourceId) -> CargoResult<()> {
-        match self.source_ids.find(namespace) {
+        match self.source_ids.get(namespace) {
             // We've previously loaded this source, and we've already locked it,
             // so we're not allowed to change it even if `namespace` has a
             // slightly different precise version listed.
@@ -213,7 +213,7 @@ impl<'a> PackageRegistry<'a> {
     // to be rewritten to a locked version wherever possible. If we're unable to
     // map a dependency though, we just pass it on through.
     fn lock(&self, summary: Summary) -> Summary {
-        let pair = self.locked.find(summary.get_source_id()).and_then(|map| {
+        let pair = self.locked.get(summary.get_source_id()).and_then(|map| {
             map.find_equiv(summary.get_name())
         }).and_then(|vec| {
             vec.iter().find(|&&(ref id, _)| id == summary.get_package_id())
@@ -242,7 +242,7 @@ impl<'a> PackageRegistry<'a> {
                 // dependency. If anything does then we lock it to that and move
                 // on.
                 None => {
-                    let v = self.locked.find(dep.get_source_id()).and_then(|map| {
+                    let v = self.locked.get(dep.get_source_id()).and_then(|map| {
                         map.find_equiv(dep.get_name())
                     }).and_then(|vec| {
                         vec.iter().find(|&&(ref id, _)| dep.matches_id(id))
index 152be313ddafe18b5c236b8ce952d9d506e3f070..203f3c7dd94b3a5fc4a3e4a4ab716bfb8b52b4ab 100644 (file)
@@ -30,7 +30,7 @@ impl EncodableResolve {
                 let pkgid = try!(pkg.to_package_id(default));
                 let precise = pkgid.get_source_id().get_precise()
                                    .map(|s| s.to_string());
-                assert!(tmp.insert(pkgid.clone(), precise),
+                assert!(tmp.insert(pkgid.clone(), precise).is_none(),
                         "a package was referenced twice in the lockfile");
                 g.add(try!(pkg.to_package_id(default)), []);
                 Ok(())
@@ -53,7 +53,7 @@ impl EncodableResolve {
                 for edge in deps.iter() {
                     let to_depend_on = try!(edge.to_package_id(default));
                     let precise_pkgid =
-                        tmp.find(&to_depend_on)
+                        tmp.get(&to_depend_on)
                            .map(|p| to_depend_on.with_precise(p.clone()))
                            .unwrap_or(to_depend_on.clone());
                     g.link(package_id.clone(), precise_pkgid);
index 326c3244700a1aa787f904df78192c5ea430a648..0f025a48d86b40f610bd422f88ab69db41ad78d6 100644 (file)
@@ -110,7 +110,7 @@ impl Resolve {
     }
 
     pub fn features(&self, pkg: &PackageId) -> Option<&HashSet<String>> {
-        self.features.find(pkg)
+        self.features.get(pkg)
     }
 }
 
@@ -199,7 +199,7 @@ fn activate_deps<'a, R: Registry>(cx: Context,
                                   dep.uses_default_features(), platform);
 
     let key = (dep.get_name().to_string(), dep.get_source_id().clone());
-    let prev_active = cx.activations.find(&key)
+    let prev_active = cx.activations.get(&key)
                                     .map(|v| v.as_slice()).unwrap_or(&[]);
     log!(5, "{}[{}]>{} {} candidates", parent.get_name(), cur, dep.get_name(),
          candidates.len());
index e79555de1fa56557dd41d6e23ed5c76401e37c2a..eb403016500d1a97038c2d4560ac70d07dfc28ae 100644 (file)
@@ -339,7 +339,7 @@ impl<'src> SourceMap<'src> {
     }
 
     pub fn get(&self, id: &SourceId) -> Option<&Source+'src> {
-        let source = self.map.find(id);
+        let source = self.map.get(id);
 
         source.map(|s| {
             let s: &Source+'src = &**s;
@@ -348,7 +348,7 @@ impl<'src> SourceMap<'src> {
     }
 
     pub fn get_mut(&mut self, id: &SourceId) -> Option<&mut Source+'src> {
-        self.map.find_mut(id).map(|s| {
+        self.map.get_mut(id).map(|s| {
             let s: &mut Source+'src = &mut **s;
             s
         })
index 6f47fe380b988b825252d733061894f7c623966b..d05685770c1343b872c26c64c0de6afc737832ba 100644 (file)
@@ -183,7 +183,7 @@ fn scrape_target_config(config: &Config,
         })),
     };
     let triple = config.target().unwrap_or(config.rustc_host()).to_string();
-    let target = match target.find(&triple) {
+    let target = match target.get(&triple) {
         None => return Ok(HashMap::new()),
         Some(target) => try!(target.table().chain_error(|| {
             internal(format!("invalid configuration for the key \
index b2bd59eb2e185d821850c9300847be11d290214e..5e9207aa91f457cec4b544032a0426a6861d70ae 100644 (file)
@@ -165,7 +165,7 @@ impl<'a, 'b: 'a> Context<'a, 'b> {
 
     pub fn get_requirement(&self, pkg: &'a Package,
                            target: &'a Target) -> PlatformRequirement {
-        self.requirements.find(&(pkg.get_package_id(), target.get_name()))
+        self.requirements.get(&(pkg.get_package_id(), target.get_name()))
             .map(|a| *a).unwrap_or(PlatformTarget)
     }
 
index 58b99153c149dd4b57ff1c5147e331239ec08320..5624528f12dfd2cd3be15bb42785af0ad25c2b5e 100644 (file)
@@ -13,7 +13,7 @@ pub fn validate(deps: &PackageSet) -> CargoResult<()> {
             Some(lib) => lib,
             None => continue,
         };
-        match map.find(&lib) {
+        match map.get(&lib) {
             Some(previous) => {
                 return Err(human(format!("native library `{}` is being linked \
                                           to by more than one package, and \
index 441c11d46db04e9781cab4c5f1284400b82fbb24..25ff599cf2de2893143eab8acb932f9fc007df30 100644 (file)
@@ -42,12 +42,12 @@ pub fn write_lockfile(dst: &Path, resolve: &Resolve) -> CargoResult<()> {
     // Note that we do not use e.toml.to_string() as we want to control the
     // exact format the toml is in to ensure pretty diffs between updates to the
     // lockfile.
-    let root = e.toml.find(&"root".to_string()).unwrap();
+    let root = e.toml.get(&"root".to_string()).unwrap();
 
     out.push_str("[root]\n");
     emit_package(root.as_table().unwrap(), &mut out);
 
-    let deps = e.toml.find(&"package".to_string()).unwrap().as_slice().unwrap();
+    let deps = e.toml.get(&"package".to_string()).unwrap().as_slice().unwrap();
     for dep in deps.iter() {
         let dep = dep.as_table().unwrap();
 
@@ -55,7 +55,7 @@ pub fn write_lockfile(dst: &Path, resolve: &Resolve) -> CargoResult<()> {
         emit_package(dep, &mut out);
     }
 
-    match e.toml.find(&"metadata".to_string()) {
+    match e.toml.get(&"metadata".to_string()) {
         Some(metadata) => {
             out.push_str("[metadata]\n");
             out.push_str(metadata.to_string().as_slice());
@@ -75,7 +75,7 @@ fn emit_package(dep: &toml::TomlTable, out: &mut String) {
         out.push_str(format!("source = {}\n", lookup(dep, "source")).as_slice());
     }
 
-    if let Some(ref s) = dep.find(&"dependencies".to_string()) {
+    if let Some(ref s) = dep.get(&"dependencies".to_string()) {
         let slice = s.as_slice().unwrap();
 
         if !slice.is_empty() {
@@ -92,5 +92,5 @@ fn emit_package(dep: &toml::TomlTable, out: &mut String) {
 }
 
 fn lookup<'a>(table: &'a toml::TomlTable, key: &str) -> &'a toml::Value {
-    table.find(&key.to_string()).expect(format!("Didn't find {}", key).as_slice())
+    table.get(&key.to_string()).expect(format!("Didn't find {}", key).as_slice())
 }
index e762d9feb4962356f3a54f27c20500cb49f1c2d2..008ca63c3cfb9895b9c48ab9a93cadf7a6172045 100644 (file)
@@ -317,8 +317,8 @@ impl<'a, 'b> RegistrySource<'a, 'b> {
         }
 
         // Verify what we just downloaded
-        let expected = self.hashes.find(&(pkg.get_name().to_string(),
-                                          pkg.get_version().to_string()));
+        let expected = self.hashes.get(&(pkg.get_name().to_string(),
+                                         pkg.get_version().to_string()));
         let expected = try!(expected.require(|| {
             internal(format!("no hash listed for {}", pkg))
         }));
index 941bf5d742d9bd1111d138c7c705a4d4ef6e8650..398cd08985ad8386d49436b8273b1a59eec2441e 100644 (file)
@@ -324,7 +324,7 @@ fn walk_tree(pwd: &Path,
 fn extract_config(mut file: File, key: &str) -> CargoResult<ConfigValue> {
     let contents = try!(file.read_to_string());
     let mut toml = try!(cargo_toml::parse(contents.as_slice(), file.path()));
-    let val = try!(toml.pop(&key.to_string()).require(|| internal("")));
+    let val = try!(toml.remove(&key.to_string()).require(|| internal("")));
 
     ConfigValue::from_toml(file.path(), val)
 }
index 3b4028ea6d177f7bc57eeca5012d5f0e9f56720f..9ffadafc0b77018c9ce8bed2aae488ddd3f447ba 100644 (file)
@@ -86,7 +86,7 @@ impl<C, K: Dependency<C>, V> DependencyQueue<K, V> {
             };
             assert!(rev.insert(key.clone()));
         }
-        assert!(self.dep_map.insert(key, (my_dependencies, value)));
+        assert!(self.dep_map.insert(key, (my_dependencies, value)).is_none());
     }
 
     /// Dequeues a package that is ready to be built.
@@ -100,7 +100,7 @@ impl<C, K: Dependency<C>, V> DependencyQueue<K, V> {
             Some(key) => key,
             None => return None
         };
-        let (_, data) = self.dep_map.pop(&key).unwrap();
+        let (_, data) = self.dep_map.remove(&key).unwrap();
         let fresh = if self.dirty.contains(&key) {Dirty} else {Fresh};
         self.pending.insert(key.clone());
         Some((fresh, key, data))
@@ -117,7 +117,7 @@ impl<C, K: Dependency<C>, V> DependencyQueue<K, V> {
     /// possibly allowing the next invocation of `dequeue` to return a package.
     pub fn finish(&mut self, key: &K, fresh: Freshness) {
         assert!(self.pending.remove(key));
-        let reverse_deps = match self.reverse_dep_map.find(key) {
+        let reverse_deps = match self.reverse_dep_map.get(key) {
             Some(deps) => deps,
             None => return,
         };
index 3ed6cc584b6aa7b600169d7e97aa171e5ba99846..119ab092d133ff807d32a19218f68f0b2abbaa31 100644 (file)
@@ -37,7 +37,7 @@ impl<N: Eq + Hash + Clone> Graph<N> {
     }
 
     pub fn edges(&self, node: &N) -> Option<Edges<N>> {
-        self.nodes.find(node).map(|set| set.iter())
+        self.nodes.get(node).map(|set| set.iter())
     }
 
     pub fn sort(&self) -> Option<Vec<N>> {